package com.obas.integration.element.telnet.editor;

import org.apache.commons.lang.StringUtils;

import com.ease.common.util.Detect;
import com.ease.common.util.MacAddressUtil;
import com.ease.common.vo.MacAddress;
import com.ease.common.vo.editor.AbstractObjectEditor;
import com.obas.model.business.DeviceMacAddress;

public abstract class AbstractTelnetEditor extends AbstractObjectEditor<DeviceMacAddress> {

	public static String formatString(String value) {
		value = StringUtils.trimToEmpty(value);
		if (Detect.notEmpty(value)) {
			return value;
		}
		return null;
	}

	public static String asMacAddress(String value) {
		MacAddress macAddress = MacAddressUtil.asMacAddress(value);
		return null != macAddress ? MacAddressUtil.as3ColonString(macAddress) : null;
	}

}
